package com.gk.panda.apis.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gk.panda.apis.mapper.DictionaryMapper;
import com.gk.panda.apis.service.DictionaryService;
import com.gk.panda.pojo.Dictionary;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @author: wangchao
 * @date: 2022/12/16 17:39
 * @version: 1.0
 **/
@Service
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Dictionary> implements DictionaryService {

    /**
     * 根据字典项名称获取字典项值
     * @param name
     * @return
     */
    @Override
    public String getValue(String name) {
        QueryWrapper<Dictionary> wrapper = new QueryWrapper<>();
        wrapper.eq("name",name);
        return this.getOne(wrapper).getValue();
    }
}
